<template>
   <div class=''>
        <van-goods-action>
            <van-goods-action-icon :icon="isShowStar?'star':'star-o'" :text="!isShowStar?'未收藏':'已收藏'" 
            :color="isShowStar?'#ff5000':'#666'" @click="changeShowStar"/>
            <van-goods-action-icon icon="cart-o" text="购物车" :badge="goodsCount"/>
            <van-goods-action-button type="danger" text="立即购买" @click="goToBuy"/>
            <van-goods-action-button type="warning" text="加入购物车"  @click="goToCard"/>
        </van-goods-action>
   </div>
</template>

<script>
export default {
    data () {
        return {
            isShowStar:false,
        }
    },
    methods:{
        changeShowStar(){
            this.isShowStar = !this.isShowStar
        },
        goToCard(){
            this.$emit("goToCard")
        },
        goToBuy(){
            console.log("wu")
        }
    },
    props:["goodsCount"]
}
</script>
<style lang="less" scoped>
    .van-goods-action{
        z-index: 9999;
    }
</style>